Signals blocks

Signal blocks include fucntions for processing and filter signals, control inputs and outputs, etc.

3D Table Interpolation

3D Table Interpolation block returns the value obtained interpolating the configured table with the input variables.

../../../_images/3d_table.png

3D Table Interpolation block

  • Inputs

    real Pin 0: X component, columns.

    real Pin 1: Y component, rows.

  • Output

    real Pin 0: Value interpolated from table for the input X and Y components.

  • Configuration menu:

    ../../../_images/3d_table_configuration.png

    3D Table Interpolation block configuration

    • Sort: By pressing this button, rows and columns are sorted from lowest to highest.

    • Add: A row/column is added

    Note

    If out of range, the value for the closest limit shall be taken

Bound

Bound block limits the input signal and produces a bit to indicate if it was within the allowed range.

../../../_images/bound.png

Bound block

  • Inputs

    real (Optional) min: Minimum value allowed for input signal. If not defined, it is assumed to be infinity.

    real in: Input signal.

    real (Optional) max: Maximum allowed value for input signal. If not defined, it is assumed to be infinity.

  • Outputs

    real out: Limited signal.

    bit in range: Bit that is true when the input signal is within the allowed range and false otherwise.

User can use the Bound block to monitor critical system parameters that are within operating limits, e.g. airspeed. If not OK, in range can be used to trigger an alarm.

../../../_images/bound_example.png

Bound block - Example of use

EWMA Tau filter

EWMA (Exponentially Weighted Moving Average) Tau filter block is a simple first order filter with configurable time constant Tau.

This filter follows the following equation:

\[y = \alpha \cdot u + (1 - \alpha) \cdot y_{-1}\]

Where:

  • \(\large{\alpha = \frac{dt}{dt + \tau}}\)

    • \(dt\): GNC Timestamp

    • \(\tau\): Time constant

  • \(u\): Input value to be filtered

  • \(y_{-1}\): Initialization value at the first execution of the block (t=0)

../../../_images/ewma.png

EWMA Tau filter block

  • Inputs

    real u0: Initialization value (set in on_focus).

    real u: Current value to filter.

  • Output

    real Pin 0: Filtered value.

  • Configuration menu:

    ../../../_images/ewma_configuration.png

    EWMA Tau filter block configuration

    • Tau: The time constant Tau must be entered.

FFT

Error

The FFT block is temporarily disabled in this version.

FFT (Fast Fourier Transform) block outputs the Fast Fourier Transform of the input signal.

../../../_images/fft.png

FFT block

  • Input

    real in: Input signal.

  • Outputs

    real Amax: 3D vector containing the magnitude of the three dominant frequencies (sorted from higher to lower magnitude).

    real Fmax: 3D vector containing the frequency of the three dominant frequencies (sorted from higher to lower magnitude).

  • Configuration menu:

    ../../../_images/fft_configuration.png

    FFT block configuration

    • Stages.

    • Computing time.

Hysteresis

Hysteresis block applies hysteresis to input signal to prevent changes in output signal when the input is close to zero.

../../../_images/hysteresis.png

Hysteresis block

The behaviour is as shown in the following diagram:

../../../_images/hysteresis_diagram.png

Hysteresis diagram

  • Input

    real Pin 0: Input signal.

  • Output

    real Pin 0: Output signal.

  • Configuration menu:

    ../../../_images/hysteresis_configuration.png

    Hysteresis block configuration

    • Hysteresis: Users must enter the magnitud of the hysteresis.

IIR Filter

IIR Filter block allows the user to define an Infinite Input Response filter, it applies a Z-transform.

../../../_images/iir_filter.png

IIR Filter block

  • Input

    real Pin 0: Input signal.

  • Output

    real Pin 0: Output signal.

  • Configuration menu:

    ../../../_images/iir_filter_configuration.png

    IIR Filter block configuration

    • A: Filter a coefficients. The user can add as many coefficients a as desired.

    • B: Filter b coefficients. The user can add as many coefficients b as desired.

    • Respect to IIR: If enabled, the first time the block is executed, it takes the value of input as the initial offset.

This block can be used as a derivative if configured as shown in the following figure:

../../../_images/iir_filter_example.png

IIR Filter block - Derivative example

Interpolation Vector

Interpolation Vector block applies the configured table interpolation over each of the components of the input vector.

../../../_images/interp_vec.png

Interp Vec block

  • Input

    real X: Input vector.

  • Output

    real Y: Interpolated output vector.

  • Configuration menu:

    ../../../_images/interp_vec_configuration.png

    Interp Vec block configuration

    • add: Users should add as many Vector elements as there are components in the input vector.

    • Points: The interpolation function of each component must be configured by the user. It is represented by the graph below.

    • Invert: If enabled, the y axis of the function will correspond to the input vector and the x axis to the interpolated output vector.

Ramp

Ramp block will ramp up to the final value defined as input, starting from the initial value defined as input, and respecting the parameters Ramp Delay and Ramp Time.

../../../_images/ramp.png

Ramp block

  • Inputs

    real u0: Initial value of the ramp, read only in on_focus.

    real u: Final value of the ramp, updated in each step.

  • Output

    real Pin 0: Output ramp value.

  • Configuration menu:

    ../../../_images/ramp_configuration.png

    Ramp block configuration

    • Ramp Delay: Time before starting the ramp.

    • Ramp Time: Time in which the variable must change from the initial value to the final value.

Rate limiter

Rate limiter block limits the rate of change of the input signal. Ir returns the signal input, but limiting its maximum rate of change.

../../../_images/rate_limiter.png

Rate limiter block

If the rate of change of the input is higher than the maximum, the output will try to converge to the input, but respecting the imposed maximum rate of change.

The first time the block is executed the output will be equal to Init.

  • Inputs

    real Init: Initialization value, this is the output of the block in the first step after on_focus.

    real Signal: Input signal.

    real (Optional) Up limit: Rate limit in the up direction. The value is read as absolute value, this means that the sign of this input is neglected.

    real (Optional) Down limit: Rate limit in the down direction. The value is read as absolute value, this means that the sign of this input is neglected.

  • Output

    real Pin 0: Rate-limited signal.

  • Configuration menu:

    ../../../_images/rate_limiter_configuration.png

    Rate limiter block configuration

    • Angle wrap: Perform a [-pi, pi] wrap. It should be enable when using angles.

This block can be used to avoid instantaneous spikes and spikes in control signals, effectively reducing control noise and smoothing flight:

../../../_images/rate_limiter_example.png

Rate limiter block - Example of use

Signal generator

Signal generator block is a wave signal generator.

../../../_images/signal_generator.png

Signal generator block

  • Output

    real Pin 0: Signal generated according to the configured type.

  • Configuration menu:

    ../../../_images/signal_generator_configuration.png

    Signal generator block configuration

    • Frequency: Frequency of the signal.

    • Gain: Gain of the signal

    • Signal type: Users must select the type of signal to be generated. The available options are: Sine, Sqaure, Triangle and Sawtooth.

      Note

      An example of the shape of each type of signal is shown below.

    • Duty cycle: Duty cycle of the signal. Can only be modified when Square signal is selected.

An example is given below:

../../../_images/signal_generator_example2.png

Signal generator block - Configuration example

../../../_images/signal_generator_example1.png

Signal generator block - Example of signal generated